<link href="${rc.getContextPath()}/static/css/dwzCustomCss/dwz.custom.css" rel="stylesheet" type="text/css">
<script type="text/javascript">
$(function(){
    $("div#configtree ul.tree li").contextMenu('configTreeZH', {
        shadow : false,
        bindings : {
            addConfCategory : function(t) {
                _addConfigCategory(t);
            },
            addConf : function(t) {
                _addConfig(t);
            },
            delConfCategory : function(t) {
                _delConfCategory(t);
            },
            delConf : function(t) {
                _delConfig(t);
            }
        },
        ctrSub : function(t, m) {
            /**
             * 获取当级树的内容
             */
            var $a = _getChildren(t);
            var _type = $a.attr("type");
            /*
             * 判断是否存在type
             */
            if(typeof _type ==="undefined" || _type === null){
                m.find("[rel='addConfCategory']").hide();
                m.find("[rel='addConf']").hide();
                m.find("[rel='delConfCategory']").hide();
                m.find("[rel='delConf']").hide();
            }
            if(_type == "project"){
                m.find("[rel='addConfCategory']").hide();
                m.find("[rel='addConf']").hide();
                m.find("[rel='delConfCategory']").hide();
            }else if(_type == "folder"){
                m.find("[rel='delConf']").hide();
            }
        }
    });
    
    $("a#searchTree",navTab.getCurrentPanel()).baseTreeSearch({
        inputTextId : "#searchConfig", //搜索框的id
        alertMsg : "<@label key='treeSearchContent.D'>请输入内容再查找</@label>", //提示内容，要考虑国际化，传自后台
        $p : navTab.getCurrentPanel()
    });
    
    $("#collapsable",navTab.getCurrentPanel())._treeCollapsable({
        $p : navTab.getCurrentPanel()
    })
    
    $("#expandable",navTab.getCurrentPanel())._treeExpandable({
        $p : navTab.getCurrentPanel()
    })
});

    function _bindChange(_pcode) {
        if(!_pcode){
            _pcode = "";
        }
        $("#config_detail").find("input[type='radio']").change(function(){
            var code = $(this).attr("value");
            if(code=="number"){
                $("#config_children").html("<fieldset><legend><@label key='Numerical.C'>数字型</@label></legend><dl><dt><@label key='Value.C,colon'>值：</@label></dt><dd><input  id='code' maxlength='10' type='text' class='digits' name ='defaultValue' /></dd></dl></fieldset>");
            }else if(code=="string"){
                $("#config_children").html("<fieldset><legend><@label key='Character.C'>字符型</@label></legend><dl><dt><@label key='Value.C,colon'>值：</@label></dt><dd><input  id='code' maxlength='255' type='text'  name ='defaultValue'/></dd></dl></fieldset>");
            }else if(code=="date"){
                $("#config_children").html("<fieldset><legend><@label key='dateType.C'>日期型</@label></legend><label><@label key='Value.C,colon'>值：</@label></label><input type='text' name='defaultValue' datefmt='yyyy-MM-dd HH:mm:ss' class='date textInput readonly valid' readonly='true'/><a class='inputDateButton' href='javascript:;'>选择</a></fieldset>");
                if ($.fn.datepicker){
                    $("input.date").each(function(){
                        var $this = $(this);
                        var opts = {};
                        if ($this.attr("dateFmt")) opts.pattern = $this.attr("dateFmt");
                        if ($this.attr("minDate")) opts.minDate = $this.attr("minDate");
                        if ($this.attr("maxDate")) opts.maxDate = $this.attr("maxDate");
                        if ($this.attr("mmStep")) opts.mmStep = $this.attr("mmStep");
                        if ($this.attr("ssStep")) opts.ssStep = $this.attr("ssStep");
                        $this.datepicker(opts);
                    });
                }
            }else if(code == "enum") {
                $("#config_children", navTab.getCurrentPanel()).loadUrl(hostUrl+"/config/getParameterValue?parameterCode="+_pcode, 
                        null, function(){ $("div#config_children").find("[layoutH]").layoutH()});
            }else if(code == "dyndata") {
                $("#config_children").html("<fieldset><legend><@label key='DynamicSQL.C'>动态数据源</@label></legend><dl style='height: auto;'><dt style='width:80px'><@label key='SQL.C,colon'>SQL语句：</@label></dt><dd><textarea class='textInput'  cols='40' rows='5' name='querySql'></textarea></dd></dl><dl><dt>&nbsp;</dt><dd style='float:left'><div class='button'><div class='buttonContent'><button onclick='_testSqlData();' type='button'><@label key='Test.B'>测试</@label></button></div></div></dd></dl></fieldset><div id='sql_test' class='pageFormContent' layoutH='0'></div>");
            }
        });
    }
    
    function _getConfigChildrens(_data) {
        var value = "";
        var sqlQuery = ""
    
        if(_data){
            if(_data.parameterCode && _data.parameterCode!=""){
                value = _data.defaultValue;
                sqlQuery = _data.querySql;
            }
            var code = _data.valueTypeECode;
            if(code=="number"){
                $("#config_children").html("<fieldset><legend><@label key='Numerical.C'>数字型</@label></legend><dl><dt><@label key='Value.C,colon'>值：</@label></dt><dd><input  id='code' type='text' maxlength='10' class='digits' name ='defaultValue' value='"+value+"'></dd></dl></fieldset>");
            }else if(code=="string"){
                $("#config_children").html("<fieldset><legend><@label key='Character.C'>字符型</@label></legend><dl><dt><@label key='Value.C,colon'>值：</@label></dt><dd><input  id='code' type='text' maxlength='255' name ='defaultValue' value='"+value+"'></dd></dl></fieldset>");
            }else if(code=="date"){
                $("#config_children").html("<fieldset><legend><@label key='dateType.C'>日期型</@label></legend><label><@label key='Value.C,colon'>值：</@label></label><input type='text' name='defaultValue' value='"+value+"' datefmt='yyyy-MM-dd HH:mm:ss' class='date textInput readonly valid' readonly='true'/><a class='inputDateButton' href='javascript:;'>选择</fieldset>");
                if ($.fn.datepicker){
                    $("input.date").each(function(){
                        var $this = $(this);
                        var opts = {};
                        if ($this.attr("dateFmt")) opts.pattern = $this.attr("dateFmt");
                        if ($this.attr("minDate")) opts.minDate = $this.attr("minDate");
                        if ($this.attr("maxDate")) opts.maxDate = $this.attr("maxDate");
                        if ($this.attr("mmStep")) opts.mmStep = $this.attr("mmStep");
                        if ($this.attr("ssStep")) opts.ssStep = $this.attr("ssStep");
                        $this.datepicker(opts);
                    });
                }
            }else if(code == "enum") {
                $("#config_children", navTab.getCurrentPanel()).loadUrl(hostUrl+"/config/getParameterValue?parameterCode="+_data.parameterCode, 
                        null, function(){ $("div#config_children").find("[layoutH]").layoutH()});
            }else if(code == "dyndata") {
                $("#config_children").html("<fieldset><legend><@label key='DynamicSQL.C'>动态数据源</@label></legend><dl style='height: auto;'><dt style='width:80px'><@label key='SQL.C,colon'>SQL语句：</@label></dt><dd><textarea class='textInput' cols='40' rows='3' name='querySql'>"+sqlQuery+"</textarea></dd></dl><dl><dt>&nbsp;</dt><dd style='float:left'><div class='button'><div class='buttonContent'><button type='button' onclick='_testSqlData();'><@label key='Test.B'>测试</@label></button></div></div></dd></dl></fieldset><div id='sql_test' class='pageFormContent' layoutH='0'></div>");
            }
        }
    }
    
    function _getChildren($obj) {
        return $obj.children("div").children("a");
    }
    function _addConfig(_node) {
        var content = _getConfigDetail("", 0, 0);
        var $a = _getChildren(_node);
        var type = $a.attr("type");
        if(!type || (type && type != "folder")){
            alertMsg.error("<@label key='Add_Config_Msg.D'>请选择目录进行操作!</@label>");
            return;
        }
        var _code = $a.attr("code");
        content.replaceAll("[parameterCode]","").replaceAll("[parameterText]","");
        content += "<input type='hidden' name='folderCode' value="+_code+">";
        $("#config_detail").html(content.replaceAll("{parameterCode}","").replaceAll("{parameterText}",""));
        //注册radio事件
        _bindChange();
        $("#configForm").attr("action", hostUrl + "/config/saveConfig");
    }
    
    function baAddConfig() {
        var node = $("div#configtree", navTab.getCurrentPanel()    ).find("div.selected").parent("li");
        if(node && node.length == 1)
            _addConfig(node);
        else
            alertMsg.error("<@label key='Add_Config_Msg.D'>请选择目录进行操作!</@label>");
    }

    function _addConfigCategory(_node) {
        var _code = "";
        if(_node && _node!=null){
            var $a = _getChildren(_node);
            var type = $a.attr("type");
            _code = $a.attr("code")
            //不是folder出错
            if(type && type != "folder"){
                alertMsg.error("<@label key='Add_Config_Msg.D'>请选择目录进行操作!</@label>");
                return;
            }
        }
        var content = _getConfigCategory(_code);
        $("#config_detail").html(content.replaceAll("{folderText}","").replaceAll("{folderCode}","").replaceAll("{displayOrdinal}",""));
        $("#configForm").attr("action", hostUrl + "/config/saveConfigCategory");
    }
    
    function editConfig(_parameterCode){
        if(_parameterCode && _parameterCode!=null){
            $.DWZajax({
                url:hostUrl +"/config/geConfigDetail",
                data:{'parameterCode':_parameterCode},
                callback:function(data){
                    if(data && data.parameterCode ){
                        var content = _getConfigDetail(data.valueTypeECode, data.systemParameterFlag, data.userParameterFlag);
                        content += "<input type='hidden' name='folderCode' value='"+data.folderCode+"' >";
                        $("#config_detail").html(content.replaceAll("{parameterCode}", data.parameterCode).replaceAll("{parameterText}", data.parameterText));
                        $("input#parameterCode").attr("readonly",true);
                        //初始化左边菜单栏 
                        _getConfigChildrens(data);
                        //注册radio事件
                        _bindChange(_parameterCode);
                        $("#configForm").attr("action", hostUrl + "/config/modifyConfig");
                    }
                }
            });
        }
    }
    
    function editConfigCategory(_folderCode) {
        if(_folderCode && _folderCode != null){
            $.DWZajax({
                url:hostUrl +"/config/getConfigCategory",
                data:{'folderCode':_folderCode},
                callback:function(data){
                    var content = _getConfigCategory(data.parentFolderCode, 'edit');
                    $("#config_detail").html(content.replaceAll("{folderText}", data.folderText).replaceAll("{folderCode}", data.folderCode).replaceAll("{displayOrdinal}",data.displayOrdinal));
                    $("input#folderCode").attr("readonly",true);
                    $("#configForm").attr("action", hostUrl + "/config/modifyConfigCategory");
                    
                }
            });
        }
    }
    
    function _getConfigCategory(_code, _type){
        $("#config_children").html("");
    
        var content = "<fieldset><legend><@label key='AddOrUpdate.C,directory.C'>新增/修改目录</@label></legend>";
        if(_type!="" && _type=="edit"){
            content += "<dl><dt><@label key='directory.C,code.C,colon'>目录编码：</@label></dt><dd><input  maxlength='40' id='folderCode' name ='folderCode' type='text' class='required readonly textInput alphanumeric toUp' value='{folderCode}' readonly='readonly' /></dd></dl>";
        }else{
            content += "<dl><dt><@label key='directory.C,code.C,colon'>目录编码：</@label></dt><dd><input maxlength='40'  id='folderCode' type='text' class='required textInput alphanumeric toUp' value='{folderCode}' remote='"
                        +hostUrl
                        +"/config/isExitsConfigCategory' name ='folderCode'/><span for='folderCode' title='<@label key='directory.C,code.C,AlreadyExists.C'>目录编码已存在</@label>' generated='false' class='error' style='display: none'></span></dd></dl>";
        }
        content += "<dl><dt><@label key='directory.C,description.C,colon'>目录描述：</@label></dt><dd><input  id='folderText' maxlength='60' type='text' class='required textInput' name ='folderText' value='{folderText}'/></dd></dl>";
        content += "<dl><dt>排序号：</dt><dd><input maxlength='9' id='displayOrdinal' type='text'  class='number textInput' name ='displayOrdinal' value='{displayOrdinal}'/></dd></dl>";
        if(_code!="" && _code != null){
            content +="<input type='hidden' name='parentFolderCode' value='"+_code+"'>";
        }
        content += _getFooterButton("<@buttonRight menuCode='directory_edit' labelKey='save.B' defalutName='保存'></@buttonRight>");
        content += "</fieldset>";
        return content;
    }
    
    function _getConfigDetail(_ecode, _isuser, _issystem){
        $("#config_children").html("");
        var configDetail = "";
        if(_ecode!=""){
            configDetail = "<fieldset><legend><@label key='AddOrUpdate.C,project.C'>新增/修改项目</@label></legend><dl><dt><@label key='project.C,code.C,colon'>项目编码：</@label></dt><dd><input maxlength='64' type='text' id='parameterCode' name ='parameterCode' class='required readonly textInput readonly alphanumeric toUp' value='{parameterCode}' readonly='readonly'> </dd></dl>";
        }else{
            configDetail = "<fieldset><legend><@label key='AddOrUpdate.C,project.C'>新增/修改项目</@label></legend><dl><dt><@label key='project.C,code.C,colon'>项目编码：</@label></dt><dd><input maxlength='64' type='text' id='parameterCode' name ='parameterCode' value='{parameterCode}' class='required textInput alphanumeric toUp' remote='"
                +hostUrl
                +"/config/isExitsConfig'/><span for='parameterCode' title='<@label key='project.C,code.C,AlreadyExists.C'>项目编码已存在</@label>' generated='false' class='error' style='display: none'></span></dd></dl>";
                
        }
        configDetail += " <dl><dt><@label key='project.C,description.C,colon'>项目描述：</@label> </dt><dd><input  id='parameterText' maxlength='40' class='textInput' name ='parameterText' value='{parameterText}'/></dd></dl><dl><dt><@label key='DataType.C,colon'>数据类型：</@label></dt>";
        <#if valueTypeECode??>
        <#list valueTypeECode as ecode>
            if(${ecode_index}==0){
                if(_ecode){
                    if(_ecode=="${ecode.eCode!''}")
                        configDetail += "<dd><input type='radio' name='valueTypeECode'  readonly='readonly' checked='checked' value='${ecode.eCode!''}'/>${ecode.eCodeText!''}</dd></dl>";
                    else
                        configDetail += "<dd><input type='radio' name='valueTypeECode'  disabled value='${ecode.eCode!''}'/>${ecode.eCodeText!''}</dd></dl>";
                }else{
                    configDetail += "<dd><input type='radio' name='valueTypeECode' value='${ecode.eCode!''}'/>${ecode.eCodeText!''}</dd></dl>"; 
                }
            }else{
                if(_ecode){
                    if(_ecode=="${ecode.eCode!''}")
                        configDetail += "<dl><dt>&nbsp;</dt><dd><input type='radio' name='valueTypeECode' checked='checked' value='${ecode.eCode!''}'/>${ecode.eCodeText!''}</dd></dl>";
                    else
                        configDetail += "<dl><dt>&nbsp;</dt><dd><input type='radio' name='valueTypeECode' disabled  value='${ecode.eCode!''}'/>${ecode.eCodeText!''}</dd></dl>";

                }else{
                    configDetail += "<dl><dt>&nbsp;</dt><dd><input type='radio' name='valueTypeECode' value='${ecode.eCode!''}'/>${ecode.eCodeText!''}</dd></dl>"; 
                }
            }
        </#list>
        </#if>
        if(_isuser == 1){
            _isuser = "checked";
        }
        if(_issystem == 1){
            _issystem = "checked";
        }
        configDetail += "<dl><dt><@label key='ParameterType.C,colon'>参数类型：</@label></dt><dd><input type='checkbox' name ='systemParameterFlag' "+_isuser+" value='1'/><@label key='System_parameters.C'>系统参数</@label><input type='checkbox' name='userParameterFlag' "+_issystem+" value='1'><@label key='User_parameters.C'>用户参数</@label></dd></dl>";
        configDetail += _getFooterButton("<@buttonRight menuCode='config_edit' labelKey='save.B' defalutName='保存'></@buttonRight>");
        configDetail += "</fieldset>";
        return configDetail;
    }
    
    function _getFooterButton(_right){
        if(_right && _right!="")
            return "<dl><dt>&nbsp;</dt><dd style='float:left'><div class='buttonDisabled'><div class='buttonContent'><button type='button'><@label key='save.B'>保存 </@label></button></div></div></dd></dl>";
        return "<dl><dt>&nbsp;</dt><dd style='float:left'><div class='button'><div class='buttonContent'><button type='submit'><@label key='save.B'>保存 </@label></button></div></div></dd></dl>";
    }
    
    function _addParameterValue(_pcode) {
        var count = $("input#p_size").val();
        if(!count || count == null || count == "")
            count = 0;
        var _id = _pcode+"_"+count;
        var gridTheadTh = $(".gridThead",  navTab.getCurrentPanel()).find("table thead th");
        var tr = "<tr target='parametervalue_id' id='"+_id+"'>";
        tr += "<td style='width:"+$(gridTheadTh[0]).width()+"px'><div><input type='text' name='parameterValue["+count+"].value' class='required textInput' style='padding: 0 0px 0 0px;' /></div></td>";
        tr += "<td style='width:"+$(gridTheadTh[1]).width()+"px'><div><input type='text' name='parameterValue["+count+"].valueText' class='textInput' style='padding: 0 0px 0 0px;' /></div></td>";
        tr += "<td style='width:"+$(gridTheadTh[2]).width()+"px'><a title='<@label key='delete.B'>删除</@label>' target='ajax' class='btnDel' onclick='_delParameterValue(\""+_id+"\");'><@label key='delete.B'>删除</@label></a></td>";
        tr += "</tr>";
        if(_pcode!=""){
            tr += "<input type='hidden' name='parameterValue["+count+"].parameterCode' value='"+_pcode+"'>";
        }
        $(".gridTbody",  navTab.getCurrentPanel()).find("table tbody").append(tr);
        $("input#p_size").val(parseInt(count) + 1);
    }
    
    function _delParameterValue(_tr) {
        if(_tr){
            $("tr#"+_tr, navTab.getCurrentPanel()).remove();
        }
    }
    
    function _testSqlData(){
        var sql = $("textarea[name='querySql']").val();
        if(!sql || sql == ""){
            alertMsg.error("<@label key='Test_Sql_Msg.D'>测试前先输入要测试的sql！</@label>");
            return;
        }
        $("div#sql_test", navTab.getCurrentPanel()).loadUrl(hostUrl+"/config/testSqlData", {sql:sql}, function(){ $("div#config_children").find("[sql_test]").layoutH()});
        
    }
    
    function _delConfCategory(_node) {
        if(_node && _node!=null){
            var $a = _getChildren(_node);
            var type = $a.attr("type");
            var isLeaf = $a.attr("isLeaf")
            //不是folder出错
            if(type && type != "folder"){
                alertMsg.error("<@label key='Add_Config_Msg.D'>请选择目录进行操作!</@label>");
                return;
            }
            if(isLeaf == "no"){
                alertMsg.error("<@label key='Tree_delete_msg.D'>非叶子节点不能删除!</@label>");
                return;
            }
            var _code = $a.attr("code");
            alertMsg.confirm("<@label key='delete_sure.D'>确定删除</@label>【"+$a.attr("name")+"】？",{
                okCall:function(){
                    $.DWZajax({
                        url:hostUrl +"/config/deleteConfigCategory",
                        data:{'folderCode':_code},
                        callback:function(data){
                            alertMsg.correct("<@label key='Tree_deleteS_msg.D'>成功删除</@label>【"+$a.attr("name")+"】");
                            navTab.reload(hostUrl + "/config/commonConfig?navTabId=${navTabId!''}");
                        }
                    });
                }
            });
        }
    }
    
    function _delConfig(_node){
        if(_node && _node!=null){
            var $a = _getChildren(_node);
            var _code = $a.attr("code");
            var type = $a.attr("type");
            if(type && type != "project"){
                alertMsg.error("<@label key='Add_ConfigP_Msg.D'>请选择项目进行操作!</@label>");
                return;
            }
            alertMsg.confirm("<@label key='delete_sure.D'>确定删除</@label>【"+$a.attr("name")+"】？",{
                okCall:function(){
                    $.DWZajax({
                        url:hostUrl +"/config/deleteConfig",
                        data:{'parameterCode':_code},
                        callback:function(data){
                            alertMsg.correct("<@label key='Tree_deleteS_msg.D'>成功删除</@label>【"+$a.attr("name")+"】");
                            navTab.reload(hostUrl + "/config/commonConfig?navTabId=${navTabId!''}");
                        }
                    });
                }
            });
        
        }else{
            alertMsg.error("<@label key='Add_ConfigP_Msg.D'>请选择项目进行操作!</@label>");
        }
    }
    
    function baDelConfigCategory() {
        var node = $("div#configtree", navTab.getCurrentPanel()    ).find("div.selected").parent("li");
        if(node && node.length == 1)
            _delConfCategory(node);
        else
            alertMsg.error("<@label key='Add_Config_Msg.D'>请选择目录进行操作!</@label>");
    }
    function baDelConfig() {
        var node = $("div#configtree", navTab.getCurrentPanel()    ).find("div.selected").parent("li");
        if(node && node.length == 1)
            _delConfig(node);
        else
            alertMsg.error("<@label key='Add_ConfigP_Msg.D'>请选择项目进行操作!</@label>");
    }

    
</script>
<div class="pageContent ">
            <div>
                <div id="configtree" class="treeleft">
                    <div class="mini-toolbar">
                        <input type="text" id="searchConfig" /> <a class="buttonActive" href="javascript:void(0)" id="searchTree"><span><@label key='search.B'>搜索</@label></span>
                        </a>
                    </div>
                    <div class="pBar pBarBorder">
                        <ul class="toolBar">
                            <@buttonRight menuCode="directory_add" labelKey="add.B,directory.C" defalutName="新增目录">
                            <li><a class="add" onclick="_addConfigCategory();" title="<@label key='add.B,directory.C'>新增目录</@label>"><span><@label key="add.B,directory.C">新增目录</@label></span>
                            </a>
                            </li></@buttonRight> <@buttonRight menuCode="config_add" labelKey="add.B,project.C" defalutName="新增项目">
                            <li><a class="add" onclick="baAddConfig();" title="<@label key='add.B,project.C'>新增项目</@label>"><span><@label key="add.B,project.C">新增项目</@label></span>
                            </a>
                            </li></@buttonRight> <@buttonRight menuCode="directory_delete" labelKey="delete.B,directory.C" defalutName="删除目录">
                            <li><a class="delete" onclick="baDelConfigCategory();" title="<@label key='delete.B,directory.C'>删除目录</@label>"><span><@label key="delete.B,directory.C">删除目录</@label></span>
                            </a>
                            </li></@buttonRight>
                        </ul>
                    </div>
                    <div id="menuBar" class="pBar pBarBorder">
                        <ul class="toolBar">
                         <@buttonRight menuCode="config_delete" labelKey="delete.B,project.C" defalutName="删除项目">
                            <li><a class="delete" onclick="baDelConfig();" title="<@label key='delete.B,project.C'>删除项目</@label>"><span><@label key="delete.B,project.C">删除项目</@label></span>
                            </a>
                            </li></@buttonRight>
                            <li><a class="collapse" id="collapsable" title="<@label key="collapseAll.D">全部收起</@label>"><span><@label key="collapse.B">收起</@label></span> </a></li>
                            <li><a class="expand" id="expandable" title="<@label key="expandAll.D">全部展开</@label>"><span><@label key="expand.B">展开</@label></span> </a></li>
                        </ul>
                    </div>
                    <div layoutH="95">
                        <ul class="tree treeFolder expand">
                            <#if parameterFolders??> <#list parameterFolders as folders>
                            <li><a type="folder" name="${folders.folderText!''}" code="${folders.folderCode!''}" isLeaf="${folders.isLeaf?string('yes','no')}" onclick="editConfigCategory('${folders.folderCode!''}')">${folders.folderText!''}</a> <#if !folders.isLeaf>
                                <ul>
                                    <#if folders.parameters??> <#list folders.parameters as parameter>
                                    <li><a type="project" code="${parameter.parameterCode!''}" name="${parameter.parameterText!''}" onclick="editConfig('${parameter.parameterCode!''}')">${parameter.parameterText!''}</a>
                                    </li> </#list> </#if> <@configtree children = folders.childrens />
                                </ul> <#else>
                                <ul></ul> </#if></li> </#list> </#if>
                        </ul>
                    </div>
                </div>
                <form action="" id="configForm" method="post" class="required-validate" onsubmit="return validateCallback(this, navTabAjaxDone)">
                    <div id="config_detail" class="unitBox pageFormContent" style="float: left; overflow: auto; width: 400px;">
                    </div>
                    <div id="config_children" class="pageFormContent" style="margin-left: 420px;" layoutH="0"></div>
                </form>


    </div>
</div>
<!-- 递归产生树的宏定义 -->
<#macro configtree children> <#if children?? && children?size gt 0> <#list children as child>
<li><a type="folder" code="${child.folderCode!''}" name="${child.folderText!''}" isLeaf="${child.isLeaf?string('yes','no')}" onclick="editConfigCategory('${child.folderCode!''}')">${child.folderText!''}</a> <#if !child.isLeaf>
    <ul>
        <#if child.parameters??> <#list child.parameters as parameter>
        <li><a type="project" code="${parameter.parameterCode!''}" name="${parameter.parameterText!''}" onclick="editConfig('${parameter.parameterCode!''}')">${parameter.parameterText!''}</a>
        </li> </#list> </#if> <#if child.childrens??> <@configtree children=child.childrens /> </#if>
    </ul> <#else>
    <ul></ul> </#if></li>
</#list> </#if> </#macro>
